<?php

namespace app\common\validate;
use think\Validate;

class Member extends Validate{

	protected $rule=[
		'username|用户名'=>'require',
		'password|密码'=>'require',
		'conpass|确认密码'=>'require|confirm:password',
		'nickname|昵称'=>'require',
		'email|邮箱'=>'require|email|unique:member',
		'oldpassword|原密码'=>'require',
		'newpassword|新密码'=>'require',
		'newconpass|确认新密码'=>'require'
		
	];

	public function sceneAdd(){
		return $this->only(['username','password','conpass','nickname','email'])
		->append('username','unique:member');
	}
	//修改
	public function sceneEdit(){
		return $this->only(['oldpassword','nickname','email','newpassword','newconpass']);
	}

}


